home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / hash.z / hash
Encoding:
Text File  |  2002-10-03  |  7.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      HHHHAAAASSSSHHHH((((3333))))          UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))          HHHHAAAASSSSHHHH((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           hash - hash database access method
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.           ####iiiinnnncccclllluuuuddddeeee <<<<ddddbbbb....hhhh>>>>
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.           The routine _d_b_o_p_e_n is the library interface to database
  17.           files.  One of the supported file formats is hash files.
  18.           The general description of the database access methods is in
  19.           _d_b_o_p_e_n(3), this manual page describes only the hash specific
  20.           information.
  21.  
  22.           The hash data structure is an extensible, dynamic hashing
  23.           scheme.
  24.  
  25.           The access method specific data structure provided to _d_b_o_p_e_n
  26.           is defined in the <db.h> include file as follows:
  27.  
  28.           typedef struct {
  29.                u_int bsize;
  30.                u_int ffactor;
  31.                u_int nelem;
  32.                u_int cachesize;
  33.                u_int32_t (*hash)(const void *, size_t);
  34.                int lorder;
  35.           } HASHINFO;
  36.  
  37.           The elements of this structure are as follows:
  38.  
  39.           bsize
  40.                _B_s_i_z_e defines the hash table bucket size, and is, by
  41.                default, 256 bytes.  It may be preferable to increase
  42.                the page size for disk-resident tables and tables with
  43.                large data items.
  44.  
  45.           ffactor
  46.                _F_f_a_c_t_o_r indicates a desired density within the hash
  47.                table.  It is an approximation of the number of keys
  48.                allowed to accumulate in any one bucket, determining
  49.                when the hash table grows or shrinks.  The default
  50.                value is 8.
  51.  
  52.           nelem
  53.                _N_e_l_e_m is an estimate of the final size of the hash
  54.                table.  If not set or set too low, hash tables will
  55.                expand gracefully as keys are entered, although a
  56.                slight performance degradation may be noticed.  The
  57.                default value is 1.
  58.  
  59.           cachesize
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      HHHHAAAASSSSHHHH((((3333))))          UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))          HHHHAAAASSSSHHHH((((3333))))
  71.  
  72.  
  73.  
  74.                A suggested maximum size, in bytes, of the memory
  75.                cache.  This value is oooonnnnllllyyyy advisory, and the access
  76.                method will allocate more memory rather than fail.
  77.  
  78.           hash _H_a_s_h is a user defined hash function.  Since no hash
  79.                function performs equally well on all possible data,
  80.                the user may find that the built-in hash function does
  81.                poorly on a particular data set.  User specified hash
  82.                functions must take two arguments (a pointer to a byte
  83.                string and a length) and return a 32-bit quantity to be
  84.                used as the hash value.
  85.  
  86.           lorder
  87.                The byte order for integers in the stored database
  88.                metadata.  The number should represent the order as an
  89.                integer; for example, big endian order would be the
  90.                number 4,321.  If _l_o_r_d_e_r is 0 (no order is specified)
  91.                the current host order is used.  If the  file already
  92.                exists, the specified value is ignored and the value
  93.                specified when the tree was created is used.
  94.  
  95.           If the file already exists (and the O_TRUNC flag is not
  96.           specified), the values specified for the parameters bsize,
  97.           ffactor, lorder and nelem are ignored and the values
  98.           specified when the tree was created are used.
  99.  
  100.           If a hash function is specified, _h_a_s_h__o_p_e_n will attempt to
  101.           determine if the hash function specified is the same as the
  102.           one with which the database was created, and will fail if it
  103.           is not.
  104.  
  105.           Backward compatible interfaces to the routines described in
  106.           _d_b_m(3), and _n_d_b_m(3) are provided, however these interfaces
  107.           are not compatible with previous file formats.
  108.  
  109.      EEEERRRRRRRROOOORRRRSSSS
  110.           The _h_a_s_h access method routines may fail and set _e_r_r_n_o for
  111.           any of the errors specified for the library routine
  112.           _d_b_o_p_e_n(3).
  113.  
  114.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  115.           _b_t_r_e_e(3), _d_b_o_p_e_n(3), _m_p_o_o_l(3), _r_e_c_n_o(3)
  116.  
  117.           _D_y_n_a_m_i_c _H_a_s_h _T_a_b_l_e_s, Per-Ake Larson, Communications of the
  118.           ACM, April 1988.
  119.  
  120.           _A _N_e_w _H_a_s_h _P_a_c_k_a_g_e _f_o_r _U_N_I_X, Margo Seltzer, USENIX
  121.           Proceedings, Winter 1991.
  122.  
  123.      BBBBUUUUGGGGSSSS
  124.           Only big and little endian byte order is supported.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      HHHHAAAASSSSHHHH((((3333))))          UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAAuuuugggguuuusssstttt 11118888,,,, 1111999999994444))))          HHHHAAAASSSSHHHH((((3333))))
  137.  
  138.  
  139.  
  140.           This version of berkeley db (1.85) is free software which is
  141.           not developed nor maintained by SGI.  It is known to have
  142.           some bugs that are unlikely to get fixed (See NOTES below)
  143.           in particular, the following hash operations are known to
  144.           have problems, up to corrupting databases, and should be
  145.           avoided according to http://www.sleepycat.com/db.185.html:
  146.  
  147.             o  Overwriting or deleting overflow hash key/data pairs
  148.                (pairs with items larger than the page size).
  149.  
  150.             o  Intermixing hash cursor operations with deletes.
  151.  
  152.  
  153.      NNNNOOOOTTTTEEEESSSS
  154.           The default hash function in this version of db is the
  155.           Fowler/Vo/Noll hash which gives better distributions (less
  156.           collisions) on average than the publicly released version.
  157.  
  158.           This version of berkeley db is 1.85.  A newer enhanced
  159.           version db-2.x requires licensing. The db 2.x version is
  160.           more stable, faster, and supports concurrent accesses plus
  161.           many other new features.  Check out
  162.           http://www.sleepycat.com/ for details.
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.